package top.lywivan.stack;

/**
 * @author :lyw.ivan
 * @date :Created in 2022/6/3
 * @description :
 * @version: 1.0
 */
public class StackTest {
    public static void main(String[] args) {
        //创建栈
        Stack stack = new Stack();
        //元素入栈
        stack.push(1);
        stack.push(3);
        stack.push(5);
        stack.push(7);
        System.out.println("栈中元素个数:"+stack.size()+",栈是否为空:"+stack.empty());
        System.out.println("打印输出栈:"+stack);
        System.out.println("栈顶元素为："+stack.peek());
        System.out.println("元素出栈"+stack.pop());
        System.out.println("打印输出栈"+stack);
    }
}
